<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml"
      xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <title>大客户经理周拜访计划</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=e9c5bb62">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=66b457d6">
    <style>
        table input {
            border: none;
            width: 100%;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }
    </style>
</head>

<body>

<section class="content" id="app" v-cloak=>
    <div class="div-td-content-more"><i></i></div>
    <h4 style="margin-left:460px" class="wyui-progress">大客户经理拜访计划详情(本周)</h4>
    <div id="div">
        <div style="float: left">
            <div class="box-body no-padding iframeH2" style="overflow: auto;margin-left: 25px;margin-top:85pxs"
                 id="scrollDiv">
                <div id="progress" class="wyui-progress"></div>
                <table class="table  table-bordered text-center" id="week">
                    <tr class="td-module">
                        <td style="width:180px">日期</td>
                        <td style="width: 70px">创建人</td>
                        <td style="width: 100px">客户名称</td>
                        <td style="width: 100px">上次拜访时间</td>
                        <td style="width: 100px">客户地点</td>
                        <td style="width: 100px">客户行业</td>
                        <td style="width: 100px">意向设备</td>
                        <td style="width: 300px">备注</td>

                    </tr>
                    <tr v-for="(item,i) in list">
                        <td :rowspan="item.weekNamespan" :class="{hidden: item.weekNamedis}">
                            {{item.weekName}}<br>({{item.weekTime}})
                        </td>
                        <td :rowspan="item.weekNamespan" :class="{hidden: item.weekNamedis}">
                            {{item.createUserName}}
                        </td>
                        <td style="width: 120px;">
                            <span>{{item.customerName}}</span>
                        </td>
                        <td style="width: 120px;">
                            <span>{{item.lastVisitTime}}</span>
                        </td>
                        <td style="width: 120px;">
                            <span>{{item.customerAddress}}</span>
                        </td>
                        <td style="width: 120px;" class="lineOne">
                            <span>{{item.customerIndustry}}</span>
                        </td>
                        <td style="width: 120px;">
                            <span>{{item.intentionDevice}}</span>
                        </td>
                        <td class="lineOne">
                            <span>{{item.remake}}</span>
                        </td>
                    </tr>
                </table>

            </div>
        </div>

    </div>

</section>

</body>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=0b5caf39"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=0c4d95a9"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            list: []
        },
        methods: {
            Detail: function (item) {
                var that = this;
                /* url = "/reportForm/wechatshare/salerManagerList.html?flag=1&userId=" + item.userId + "&time=" + that.time + "&companyName=" + item.companyName + "&companyId=" + item.companyId + "&isToday=" + that.isToday;
                 top.closeTabByPageId("share-detail");
                 top.addTabs({id: "share-detail", title: item.companyName, close: true, url: url});*/
            },
            showDatePicker: function (e, item) {
                WdatePicker({
                    onpicked: function (dp) {
                        item.overTime = dp.cal.getNewDateStr();
                        item.lastVisitTime = dp.cal.getNewDateStr();
                        return true;
                    }
                });
                $(e.target).blur();
            },
            tablesMergeCell: function (list) {
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '') {
                                list[k][field + 'span']++;
                                list[k][field + 'dis'] = false;
                                list[i][field + 'span'] = 1;
                                list[i][field + 'dis'] = true;
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            }
        },
        mounted: function () {
            var that = this;
            var getcompanyId = $.wyui.page.urlParams.companyId;
            //$.wyui.page.getByPage();
            $.wyui.postMethod('/weekPlan/getWeekList.json', {
                companyId: getcompanyId,
                departId: getCurrentUser().departId,
                userId: getCurrentUser().id
            }, function (r) {
                that.list = r.records;
                this.list = that.tablesMergeCell(that.list);
            });
        }

    })


</script>

</html>